<template>
  <div class="page-container main">
    <!--  <div class="tool-container">
      <el-form class="tool-search" :model="queryParams" ref="queryFormRef" :inline="true">
        <el-form-item>
          <el-input type="input" placeholder="附件名称" v-model="queryParams.openid" />
        </el-form-item>

        <el-form-item>
          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
      
    </div>-->

    <div class="tabel-container myTable">
      <vxe-table ref="tableRef" :data="currentItem.refunds" v-loading="loading">
        <vxe-table-column :resizable="true" type="seq" title="序号" width="80" sortable></vxe-table-column>
        <vxe-table-column :resizable="true" field="refundReason" title="退款原因" sortable>
          <template #default="{ row }">
            {{$common.marchType(row.refundReason,dict.refund_reason)}}
          </template>
        </vxe-table-column>
        <vxe-table-column :resizable="true" field="totalOrderPayment" title="付款金额(元)" sortable>
          <template #default="{ row }"> {{row.totalOrderPayment/100}}</template>
        </vxe-table-column>
        <vxe-table-column :resizable="true" field="refundAmount" title="退款金额(元)" sortable>
          <template #default="{ row }"> {{row.refundAmount/100}}</template>
        </vxe-table-column>
        <!-- <vxe-table-column :resizable="true"  field="accessoryPrice" title="设备编码" sortable>
          <template #default="{ row }">
           {{currentItem.deviceId}}
          </template>
        </vxe-table-column>
        <vxe-table-column :resizable="true"  field="accessoryPrice" title="设备类型" sortable>
          <template #default="{ row }">
            {{$common.marchType(currentItem.deviceType,dict.device_type)}}
          </template>
        </vxe-table-column> -->
        <vxe-table-column :resizable="true" field="refundFinishTime" title="退款时间" sortable></vxe-table-column>
        <vxe-table-column :resizable="true" field="userReceivedAccount" title="退入账号" sortable></vxe-table-column>
      </vxe-table>
    </div>
    <!-- <div class="myPager">
      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </div> -->
  </div>
</template>

<script lang="ts">
import common from '@/utils/common.ts';

export default {
  props: {
    data: {}
  },
  computed: {},
  data() {
    return {
      loading: false,
      dict: {},
      users: [],
      currentItem: {
        refunds: []
      },
      total: 1,
      queryParams: {
        createBy: null,
        openid: null,
        timeFrom: '',
        timeTo: '',
        activityId: '',
        pageNum: 1,
        pageSize: 5
      }
    };
  },
  mounted() {
    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
    this.proxy = proxy;

    this.dict = toRefs<any>(this.proxy?.useDict('device_type', 'refund_reason'));

    this.init();
  },
  methods: {
    init(data) {
      if (data == null) data = this.data;
      this.currentItem = data;
    }
  }
};
</script>
